<?php
namespace Model;
use Think\Model;

/**
 * Created by PhpStorm.
 * User: Yujie
 * Date: 2018/8/31
 * Time: 16:36
 */
class ArticleModel extends Model{

    public function addOne($data){
        $ret = $this->data($data)->add();
        return $ret;
    }
    public function selectAll($w=true,$f='*',$p=0,$p_size=5){
        $ret = $this->where($w)->field($f)->limit($p,$p_size)->select();
        return $ret;
    }

    public function findOne($w,$f='*'){
        if(!$w){
            return false;
        }
        $ret = $this->where($w)->field($f)->find();
        return $ret;
    }
}